Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gogs restore report: The system cannot move the file to a different disk drive. It's caused by 'rename' file to a different disk drive on Windows Server 2019. #7748

Open
1 task done
lliding opened this issue May 18, 2024 · 0 comments
Labels
💊 bug Something isn't working

Comments

@lliding
Copy link

lliding commented May 18, 2024

Gogs version

0.13.0

Git version

  • Server: 2.44.0
  • Client: 2.44.0

Operating system

Windows Server 2019

Database

SQLite 3

Describe the bug

I run gogs.exe at D:\gogs, and create a backup.zip file. It works fine.

But when I try gogs.exe restore I get 'The system cannot move the file to a different disk drive'. It seems gogs.exe creates some files to my HOME PATH (on C:), and 'rename' these files to D:\gogs.

PS D:\gogs> .\gogs.exe backup
2024/05/18 22:33:42 [ INFO] Backup root directory: C:\Users\ld\AppData\Local\Temp\2\gogs-backup-2869618201
2024/05/18 22:33:42 [ INFO] Packing backup files to: gogs-backup-20240518223342.zip
2024/05/18 22:33:42 [ INFO] Dumping repositories in "D:\\gogs\\gogs-repositories"
2024/05/18 22:33:44 [ INFO] Repositories dumped to: C:\Users\ld\AppData\Local\Temp\2\gogs-backup-2869618201\repositories.zip
2024/05/18 22:33:45 [ INFO] Backup succeed! Archive is located at: gogs-backup-20240518223342.zip
PS D:\gogs> .\gogs.exe restore --from="d:\gogs\gogs-backup-20240518223342.zip"
2024/05/18 22:34:05 [ INFO] Restoring backup from: d:\gogs\gogs-backup-20240518223342.zip
2024/05/18 22:34:06 [FATAL] [....io/gogs/internal/cmd/restore.go:130 runRestore()] Failed to import 'custom': rename C:\Users\ld\AppData\Local\Temp\2\gogs-backup\custom D:\gogs\custom: The system cannot move the file to a different disk drive.
PS D:\gogs>

To reproduce

Run gogs.exe at D:\gogs
Create a backup.zip by 'gogs.exe backup'
Restore backup.zip by 'gogs.exe restore --from="D:\gogs\backup.zip"'

PS D:\gogs> .\gogs.exe backup
2024/05/18 22:33:42 [ INFO] Backup root directory: C:\Users\ld\AppData\Local\Temp\2\gogs-backup-2869618201
2024/05/18 22:33:42 [ INFO] Packing backup files to: gogs-backup-20240518223342.zip
2024/05/18 22:33:42 [ INFO] Dumping repositories in "D:\\gogs\\gogs-repositories"
2024/05/18 22:33:44 [ INFO] Repositories dumped to: C:\Users\ld\AppData\Local\Temp\2\gogs-backup-2869618201\repositories.zip
2024/05/18 22:33:45 [ INFO] Backup succeed! Archive is located at: gogs-backup-20240518223342.zip
PS D:\gogs> .\gogs.exe restore --from="d:\gogs\gogs-backup-20240518223342.zip"
2024/05/18 22:34:05 [ INFO] Restoring backup from: d:\gogs\gogs-backup-20240518223342.zip
2024/05/18 22:34:06 [FATAL] [....io/gogs/internal/cmd/restore.go:130 runRestore()] Failed to import 'custom': rename C:\Users\ld\AppData\Local\Temp\2\gogs-backup\custom D:\gogs\custom: The system cannot move the file to a different disk drive.
PS D:\gogs>

Expected behavior

Data on backup.zip should be restored.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@lliding lliding added the 💊 bug Something isn't working label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💊 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant